﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace DataStructure.Interview
{
    public class Question2
    {
        /// <summary>\
        /// void reverser(char* str)
        /// char *end = str;
        /// char temp;
        /// if(str)
        /// {
        ///     if(end)
        ///     {
        ///         ++end;
        ///     }
        ///     if(str < end)
        ///     {
        ///         temp = *str;
        ///         *str = *end;
        ///         *end = temp;
        ///         *str++;
        ///         *end--;
        ///     }
        /// 
        /// }
        /// </summary>
        /// <param name="str"></param>
        void reverse(string str)
        {
            str.Reverse();
        }

        public static string Reverse(string str)
        {
            unsafe
            {
                char* val = new char[str.Length];

                return new string(val);
            }
        }
    }
}
